'use strict';
angular.module('User').controller('LoginController', ['$scope', '$cookies', '$state', 'User', 'Authentication', 
    function ($scope, $cookies, $state, User, Authentication) {
        $scope.data = {
            usercode: '',
            password: '',
            rememberme: false
        };

        $scope.signin = function () {
            User.signin($scope.data.usercode, $scope.data.password, $scope.data.rememberme).then(function () {
                $state.go('index.home');
            });
        };
    }
]);
